@extends('layouts.admin.application')

@section('content')
    <div class="main-content">
        <div class="col-xs-12">
            <div class="breadcrumbs" id="breadcrumbs">
                <ul class="breadcrumb">
                    <li><i class="icon-home home-icon"></i><a href="#">首页</a></li>
                    <li><a href="{{ route('blog.gallery.index') }}">我的相册</a></li>
                    <li class="active">编辑相册</li>
                </ul>
            </div>

            @include('layouts.partials._flash')

            <form class="form-horizontal" role="form" action="{{ route('blog.gallery.update', $gallery->id) }}"
                  method="post"
                  style="margin-top: 10px;">

                {{csrf_field()}}
                {{method_field('put')}}

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">相册名称：</label>

                    <div class="col-sm-9">
                        <input type="text" name="name" class="col-xs-10 col-sm-5" value="{{$gallery->name}}">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">相册描述：</label>

                    <div class="col-sm-9">
                        <textarea name="description" cols="51" rows="4">{{$gallery->description}}</textarea>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">相册封面图：</label>

                    <div class="col-sm-9">
                        <div class="am-form-group am-form-file new_thumb">
                            <button type="button" class="btn-success upload_img" style="width: 120px;">
                                <i class="icon-cloud-upload" id="loading"></i> 上 传 美 照
                            </button>
                            <input type="file" id="image_upload" style="display: none;">
                            <input type="hidden" name="image">
                        </div>
                        <hr style="border-top:1px dashed #0066CC;">
                        <div>
                            <img src="{{$gallery->image}}" id="img_show" style="max-height: 200px;">
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right">主题：</label>

                    <div class="col-sm-9">
                        <div class="radio" style="">
                            <label>
                                <input name="type" type="radio" class="ace" value="1"
                                       @if($gallery->type == 1) checked @endif>
                                <span class="lbl"> 普通</span>
                            </label>
                            <label>
                                <input name="type" type="radio" class="ace" value="2"
                                       @if($gallery->type == 2) checked @endif>
                                <span class="lbl"> 亲子</span>
                            </label>
                            <label>
                                <input name="type" type="radio" class="ace" value="3"
                                       @if($gallery->type == 3) checked @endif>
                                <span class="lbl"> 旅游</span>
                            </label>
                        </div>
                    </div>
                </div>
                <div class="clearfix form-actions">
                    <div class="col-md-offset-3 col-md-9">
                        <button class="btn btn-info" type="submit"><i class="icon-ok bigger-110"></i>保存</button>
                        &nbsp; &nbsp; &nbsp;
                        <a class="btn" onclick="javascript:history.back(-1);return false;"><i
                                    class="icon-undo bigger-110"></i>返回</a>
                    </div>
                </div>
            </form>
        </div>

    </div>
@endsection

@section('js')
    <script src="/vendor/html5-fileupload/jquery.html5-fileupload.js"></script>
    <script src="/js/upload.js"></script>
@endsection